/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package argtrust.argsys;

import aima.core.logic.fol.parsing.ast.Sentence;
/**
 *
 * @author Yuqing Tang
 */
public class DefeatRule {
    protected Sentence mDefeater;
    protected Sentence mDefeatee;

    public DefeatRule()
    {
        
    }
    public DefeatRule(Sentence defeater,
            Sentence defeatee)
    {
        mDefeater = defeater;
        mDefeatee = defeatee;
    }

    public Sentence getDefeatee() {
        return mDefeatee;
    }

    public void setDefeatee(Sentence _Defeatee) {
        this.mDefeatee = _Defeatee;
    }

    public Sentence getDefeater() {
        return mDefeater;
    }

    public void setDefeater(Sentence _Defeater) {
        this.mDefeater = _Defeater;
    }
        private int hashCode = 0;

    @Override
    public int hashCode() {
        if (0 == hashCode) {
            hashCode = 17;
            hashCode = 37 * hashCode + mDefeater.hashCode();
            hashCode = 37 * hashCode + mDefeatee.hashCode();
        }
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DefeatRule rhs = (DefeatRule) obj;
        boolean res = true;
        if (mDefeater != null) {
            res = res && mDefeater.equals(rhs.mDefeater);
        } else {
            res = res && rhs.mDefeater == null;
        }
        if (mDefeatee != null) {
            res = res && mDefeatee.equals(rhs.mDefeatee);
        } else {
            res = res && rhs.mDefeatee == null;
        }
        return res;
    }

}
